import { Component, Output, EventEmitter, trigger, transition, style, animate, state } from "@angular/core";
import { Todo } from "../model/todo";

@Component({
  selector: 'todo-input',
  templateUrl: './todo-input.component.html',
  styleUrls: [ './todo-input.component.css' ]
})
export class TodoInputComponent {
  @Output() create = new EventEmitter()

  text = ''

  saveTodo() {
    this.create.emit(new Todo({ text: this.text }))
    this.text = ''
  }
}
